﻿document.observe("dom:loaded", loadMain);
function loadMain() {
    if (arrRemainTime.length > 0) {
        TimeCountDown_List();
    }

    /*
    if (strPhotos) {
        showListIMG();
    }
    */
}

/*************************Code for Time count down*********************************/
var time;
var strTimeCountDown = "";
var hours = 0,
	mins = 0,
	secs = 0;
function TimeCountDown_List() {

    for (var i = 0; i < arrRemainTime.length; i++) {

        if (arrRemainTime[i] > 0) {
            arrRemainTime[i] = arrRemainTime[i] - 1000;
            if (arrRemainTime[i] <= 0) {
                window.location = window.location.href;
            }
            else {
                hours = parseInt(arrRemainTime[i] / 3600000);
                mins = parseInt((arrRemainTime[i] - (hours * 3600000)) / 60000);
                secs = parseInt((arrRemainTime[i] - (hours * 3600000) - (mins * 60000)) / 1000);
                strTimeCountDown = hours + ":" + mins + ":" + secs;
                $("Time_CountDown_" + arrIDSP[i]).innerHTML = strTimeCountDown;
            }
        }
    }
    time = setTimeout("TimeCountDown_List()", 1000);
}